<template>
    <div>
        <el-form :model="form" ref="form" label-width="80px" :inline="false" size="normal">
            <el-card shadow="always" :body-style="{ padding: '20px' }">
                <div slot="header">
                    添加优势
                </div>
                <el-form-item label="优势标题">
                    <el-input v-model="form.title"></el-input>
                    <hd-error name="title"/>
                </el-form-item>
                <el-form-item label="图片展示">
                    <hd-image v-model="form.image"></hd-image>
                    <hd-error name="image"/>
                </el-form-item>
                <el-form-item label="优势内容">
                    <el-input type="textarea" rows="10" v-model="form.content"></el-input>
                    <hd-error name="content"/>
                </el-form-item>

                <el-button type="primary" @click="onSubmit">提交</el-button>

            </el-card>
        </el-form>
    </div>
</template>

<script>
export default {
    route: {name: 'admin.advantage.create'},
    data() {
        return {
            form: {}
        }
    },
    methods: {
        async onSubmit() {
            await this.axios.post('admin/advantage', this.form);
            this.$router.push({name: 'admin.advantage.edit'});
        }
    }
}
</script>

<style scoped>

</style>
